import Vue from 'vue'
import VueResource from 'vue-resource'
import BaiduMap from 'vue-baidu-map'    // 百度地图组件
import BmScale from 'vue-baidu-map/components/controls/Scale'   // 比例尺组件
import BmNavigation from 'vue-baidu-map/components/controls/Navigation'　　//　缩放组件 
import BmMarker from 'vue-baidu-map/components/overlays/Marker'　　// 标记点的组件
import BmLabel from 'vue-baidu-map/components/overlays/Label'　　　　// 标签组件，展示在标记点中的数字
import BmInfoWindow from 'vue-baidu-map/components/overlays/InfoWindow'  // 信息窗体
import echarts from 'echarts'  //引入图表
import XLSX from 'xlsx'
import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css';

// import Directives from './directives/index'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import AFTableColumn from 'af-table-column'
import delUrl from './api/common/request.js'
 
Vue.use(AFTableColumn)
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import axios from 'axios'
import qs from 'qs'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
import '@/api/quota/common/directives.js'
import uploader from 'vue-simple-uploader';

// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$http= axios
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Vue.prototype.$qs = qs

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}

Vue.prototype.$echarts = echarts

Vue.prototype.$delUrl = delUrl

// 全局组件挂载
Vue.component('Pagination', Pagination)

Vue.use(Avue);
Vue.use(permission)
Vue.use(uploader);
Vue.use(VueResource)
Vue.use(BaiduMap,{
  ak: 'yB5Uh2Gj7Vwi0ZlrsFTSKuoyCBZrTsL9'
})
Vue.use(BmScale)
Vue.use(BmNavigation)
Vue.use(BmMarker)
Vue.use(BmInfoWindow)
Vue.use(BmLabel)
Vue.use(XLSX)
// Vue.use(Directives)

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
